package com.smooth.sys.pc.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.smooth.common.site.common.rsp.ReturnResult;
import com.smooth.common.site.dao.bean.AjDict;
import com.smooth.sys.site.modules.sys.service.GDictService;

@Controller
@RequestMapping(value = "/pc")
public class BaseDictController {
	@Autowired
	GDictService gdictService;
	@RequestMapping(value = { "p/basedata/dict" }, method = { RequestMethod.POST, RequestMethod.GET })
	@ResponseBody
	public ReturnResult provinces(@RequestParam(required=true) String dictType,HttpServletRequest request, HttpServletResponse response) throws IOException {
		ReturnResult returnResult = new ReturnResult();
		
		List<AjDict>  alit = gdictService.findTypeList(dictType);
		returnResult.setData(alit);
		return returnResult;
	}
	
}
